package com.ruan.controller;

import com.ruan.entity.R;
import com.ruan.entity.User;
import com.ruan.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName:UserController
 * @Author:阮昇
 * @Description:
 * @Datetime: 2023/9/20 14:19
 **/
@RestController
@RequestMapping("/user")
@Api(tags = "用户相关接口")
public class UserController {

    @Autowired
    private UserService userService;

    @ApiOperation(value = "根据orderId获取order的own_name对应的用户数据")
    @GetMapping("/getOrderOwnData")
    @ApiImplicitParam(name = "orderId",value = "商品orderId",required = true,dataType = "Integer")
    public R<User> getOrderOwnData(Integer orderId){
        return userService.getOrderOwnData(orderId);
    }
}
